package com.lingnan.wanxiangxinxun.entity.po;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

//MongoDb数据库的实体类-->作者资格申请
@Data
@Document(collection = "AuthorApplication")
public class AuthorApplication implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;

    @Id
    private String id;
    @Indexed //添加单字段索引
    private Integer userId;
    private String name;
    private String phone;
    private String idCard;
    private Integer verifyType;

    @Indexed(expireAfter = "10d") // 设置TTL索引，过期时间为10天(日期必须是Date类型)
    private Date createdAt;
}
